3.3.4 \(\int \frac {c+d x^2}{x (a+b x^2)} \, dx\) [204]

Optimal. Leaf size=34 \[ \frac {c \log (x)}{a}-\frac {(b c-a d) \log \left (a+b x^2\right )}{2 a b} \]

[Out]

c*ln(x)/a-1/2*(-a*d+b*c)*ln(b*x^2+a)/a/b

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 34, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {457, 78} \begin {gather*} \frac {c \log (x)}{a}-\frac {(b c-a d) \log \left (a+b x^2\right )}{2 a b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x^2)/(x*(a + b*x^2)),x]

[Out]

(c*Log[x])/a - ((b*c - a*d)*Log[a + b*x^2])/(2*a*b)

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 457

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rubi steps

\begin {align*} \int \frac {c+d x^2}{x \left (a+b x^2\right )} \, dx &=\frac {1}{2} \text {Subst}\left (\int \frac {c+d x}{x (a+b x)} \, dx,x,x^2\right )\\ &=\frac {1}{2} \text {Subst}\left (\int \left (\frac {c}{a x}+\frac {-b c+a d}{a (a+b x)}\right ) \, dx,x,x^2\right )\\ &=\frac {c \log (x)}{a}-\frac {(b c-a d) \log \left (a+b x^2\right )}{2 a b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 34, normalized size = 1.00 \begin {gather*} \frac {c \log (x)}{a}+\frac {(-b c+a d) \log \left (a+b x^2\right )}{2 a b} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x^2)/(x*(a + b*x^2)),x]

[Out]

(c*Log[x])/a + ((-(b*c) + a*d)*Log[a + b*x^2])/(2*a*b)

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 33, normalized size = 0.97

method result size
default \(\frac {\left (a d -b c \right ) \ln \left (b \,x^{2}+a \right )}{2 a b}+\frac {c \ln \left (x \right )}{a}\) \(33\)
norman \(\frac {\left (a d -b c \right ) \ln \left (b \,x^{2}+a \right )}{2 a b}+\frac {c \ln \left (x \right )}{a}\) \(33\)
risch \(\frac {c \ln \left (x \right )}{a}+\frac {\ln \left (-b \,x^{2}-a \right ) d}{2 b}-\frac {\ln \left (-b \,x^{2}-a \right ) c}{2 a}\) \(43\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x^2+c)/x/(b*x^2+a),x,method=_RETURNVERBOSE)

[Out]

1/2*(a*d-b*c)/a/b*ln(b*x^2+a)+c*ln(x)/a

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 35, normalized size = 1.03 \begin {gather*} \frac {c \log \left (x^{2}\right )}{2 \, a} - \frac {{\left (b c - a d\right )} \log \left (b x^{2} + a\right )}{2 \, a b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x^2+c)/x/(b*x^2+a),x, algorithm="maxima")

[Out]

1/2*c*log(x^2)/a - 1/2*(b*c - a*d)*log(b*x^2 + a)/(a*b)

________________________________________________________________________________________

Fricas [A]
time = 0.89, size = 33, normalized size = 0.97 \begin {gather*} \frac {2 \, b c \log \left (x\right ) - {\left (b c - a d\right )} \log \left (b x^{2} + a\right )}{2 \, a b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x^2+c)/x/(b*x^2+a),x, algorithm="fricas")

[Out]

1/2*(2*b*c*log(x) - (b*c - a*d)*log(b*x^2 + a))/(a*b)

________________________________________________________________________________________

Sympy [A]
time = 0.40, size = 26, normalized size = 0.76 \begin {gather*} \frac {c \log {\left (x \right )}}{a} + \frac {\left (a d - b c\right ) \log {\left (\frac {a}{b} + x^{2} \right )}}{2 a b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x**2+c)/x/(b*x**2+a),x)

[Out]

c*log(x)/a + (a*d - b*c)*log(a/b + x**2)/(2*a*b)

________________________________________________________________________________________

Giac [A]
time = 1.68, size = 36, normalized size = 1.06 \begin {gather*} \frac {c \log \left (x^{2}\right )}{2 \, a} - \frac {{\left (b c - a d\right )} \log \left ({\left | b x^{2} + a \right |}\right )}{2 \, a b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x^2+c)/x/(b*x^2+a),x, algorithm="giac")

[Out]

1/2*c*log(x^2)/a - 1/2*(b*c - a*d)*log(abs(b*x^2 + a))/(a*b)

________________________________________________________________________________________

Mupad [B]
time = 0.04, size = 32, normalized size = 0.94 \begin {gather*} \frac {c\,\ln \left (x\right )}{a}+\frac {\ln \left (b\,x^2+a\right )\,\left (a\,d-b\,c\right )}{2\,a\,b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x^2)/(x*(a + b*x^2)),x)

[Out]

(c*log(x))/a + (log(a + b*x^2)*(a*d - b*c))/(2*a*b)

________________________________________________________________________________________